//
//  JZNearItemCell.m
//  NuoMi
//
//  Created by liangyi on 15/12/7.
//  Copyright © 2015年 liangyi. All rights reserved.
//

#import "JZNearItemCell.h"
#import "NSString+convertImgStr.h"
@implementation JZNearItemCell
-(void)setTuanListM:(JZNearTuanListModel *)tuanListM{
    _tuanListM = tuanListM;
    
    NSString *imgUrl = [NSString convertImgStr:tuanListM.image];
    [self.shopImageView sd_setImageWithURL:[NSURL URLWithString:imgUrl] placeholderImage:[UIImage imageNamed:@"ugc_photo"]];
    self.shopTitleLabel.text = tuanListM.short_title;
    self.shopDesLabel.text = tuanListM.other_desc;
    self.shopNewPriceLabel.text = [NSString stringWithFormat:@"￥%@", tuanListM.groupon_price];
    
//
    NSString * oldStr = [NSString stringWithFormat:@"%@", tuanListM.market_price];
    NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    //下划线
    //        NSDictionary *attribtDic = @{NSUnderlineStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:oldStr attributes:attribtDic];
    self.shopOldPriceLabel.attributedText = attribtStr;

    
    NSInteger i = [tuanListM.market_price integerValue];
    NSInteger ii = [tuanListM.groupon_price integerValue];
    
    
    NSString * shopActivity = [NSString stringWithFormat:@"%ld", i - ii];
    
    
    self.shopActivityLabel.text = [NSString stringWithFormat:@"立减%@元", shopActivity];
    
    
    

}

@end
